/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package ar.com.remiseria.frame;

/**
 *
 * @author mcvalls
 */
public class MenuPrincipalFrame extends javax.swing.JFrame {

    /**
     * Creates new form MenuPrincipalFrame
     */
    public MenuPrincipalFrame() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        nuevoPedidoBtn = new javax.swing.JButton();
        automovilesBtn = new javax.swing.JButton();
        choferesBtn = new javax.swing.JButton();
        destinosFrecuentesBtn = new javax.swing.JButton();
        exitBtn = new javax.swing.JButton();
        clientesBtn = new javax.swing.JButton();
        viajesBtn = new javax.swing.JButton();
        jMenuBar1 = new javax.swing.JMenuBar();
        menuMenu = new javax.swing.JMenu();
        nuevoPedidoBtnMenu = new javax.swing.JMenuItem();
        automovilesBtnMenu = new javax.swing.JMenuItem();
        choferesBtnMenu = new javax.swing.JMenuItem();
        destinosFrecuentesBtnMenu = new javax.swing.JMenuItem();
        clientesBtnMenu = new javax.swing.JMenuItem();
        viajesMenuBtn = new javax.swing.JMenuItem();
        ayudaMenu = new javax.swing.JMenu();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        nuevoPedidoBtn.setText("NUEVO PEDIDO");
        nuevoPedidoBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                nuevoPedidoBtnActionPerformed(evt);
            }
        });

        automovilesBtn.setText("Automoviles");
        automovilesBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                automovilesBtnActionPerformed(evt);
            }
        });

        choferesBtn.setText("Choferes");
        choferesBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                choferesBtnActionPerformed(evt);
            }
        });

        destinosFrecuentesBtn.setText("Destinos Frecuentes");
        destinosFrecuentesBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                destinosFrecuentesBtnActionPerformed(evt);
            }
        });

        exitBtn.setText("Salir");
        exitBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                exitBtnActionPerformed(evt);
            }
        });

        clientesBtn.setText("Clientes");
        clientesBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                clientesBtnActionPerformed(evt);
            }
        });

        viajesBtn.setText("Viajes");
        viajesBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                viajesBtnActionPerformed(evt);
            }
        });

        menuMenu.setText("Menu");

        nuevoPedidoBtnMenu.setText("Nuevo pedido");
        nuevoPedidoBtnMenu.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                nuevoPedidoBtnMenuActionPerformed(evt);
            }
        });
        menuMenu.add(nuevoPedidoBtnMenu);

        automovilesBtnMenu.setText("Administrar automoviles");
        automovilesBtnMenu.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                automovilesBtnMenuActionPerformed(evt);
            }
        });
        menuMenu.add(automovilesBtnMenu);

        choferesBtnMenu.setText("Administrar choferes");
        choferesBtnMenu.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                choferesBtnMenuActionPerformed(evt);
            }
        });
        menuMenu.add(choferesBtnMenu);

        destinosFrecuentesBtnMenu.setText("Administrar destinos frecuentes");
        destinosFrecuentesBtnMenu.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                destinosFrecuentesBtnMenuActionPerformed(evt);
            }
        });
        menuMenu.add(destinosFrecuentesBtnMenu);

        clientesBtnMenu.setText("Administrar clientes");
        clientesBtnMenu.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                clientesBtnMenuActionPerformed(evt);
            }
        });
        menuMenu.add(clientesBtnMenu);

        viajesMenuBtn.setText("Administrar viajes");
        viajesMenuBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                viajesMenuBtnActionPerformed(evt);
            }
        });
        menuMenu.add(viajesMenuBtn);

        jMenuBar1.add(menuMenu);

        ayudaMenu.setText("Ayuda");
        jMenuBar1.add(ayudaMenu);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(clientesBtn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(destinosFrecuentesBtn, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 428, Short.MAX_VALUE)
                    .addComponent(choferesBtn, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(automovilesBtn, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(nuevoPedidoBtn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(exitBtn))
                    .addComponent(viajesBtn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(15, 15, 15)
                .addComponent(nuevoPedidoBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(automovilesBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(choferesBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(destinosFrecuentesBtn)
                .addGap(18, 18, 18)
                .addComponent(clientesBtn)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 15, Short.MAX_VALUE)
                .addComponent(viajesBtn)
                .addGap(18, 18, 18)
                .addComponent(exitBtn)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void exitBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitBtnActionPerformed
        this.dispose();
    }//GEN-LAST:event_exitBtnActionPerformed

    private void nuevoPedidoBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nuevoPedidoBtnActionPerformed
        this.irAAltaPedido();
    }//GEN-LAST:event_nuevoPedidoBtnActionPerformed

    private void nuevoPedidoBtnMenuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nuevoPedidoBtnMenuActionPerformed
        this.irAAltaPedido();
    }//GEN-LAST:event_nuevoPedidoBtnMenuActionPerformed

    private void automovilesBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_automovilesBtnActionPerformed
        this.irAABMAutomoviles();
    }//GEN-LAST:event_automovilesBtnActionPerformed

    private void automovilesBtnMenuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_automovilesBtnMenuActionPerformed
        this.irAABMAutomoviles();
    }//GEN-LAST:event_automovilesBtnMenuActionPerformed

    private void choferesBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_choferesBtnActionPerformed
        this.irAABMChoferes();
    }//GEN-LAST:event_choferesBtnActionPerformed

    private void choferesBtnMenuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_choferesBtnMenuActionPerformed
        this.irAABMChoferes();
    }//GEN-LAST:event_choferesBtnMenuActionPerformed

    private void destinosFrecuentesBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_destinosFrecuentesBtnActionPerformed
        this.irAABMDestinosFrecuentes();
    }//GEN-LAST:event_destinosFrecuentesBtnActionPerformed

    private void destinosFrecuentesBtnMenuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_destinosFrecuentesBtnMenuActionPerformed
        this.irAABMDestinosFrecuentes();
    }//GEN-LAST:event_destinosFrecuentesBtnMenuActionPerformed

    private void clientesBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_clientesBtnActionPerformed
        this.irAABMClientes();
    }//GEN-LAST:event_clientesBtnActionPerformed

    private void clientesBtnMenuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_clientesBtnMenuActionPerformed
        this.irAABMClientes();
    }//GEN-LAST:event_clientesBtnMenuActionPerformed

    private void viajesBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_viajesBtnActionPerformed
        this.irAAdministracionDeViajes();
    }//GEN-LAST:event_viajesBtnActionPerformed

    private void viajesMenuBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_viajesMenuBtnActionPerformed
        this.irAAdministracionDeViajes();
    }//GEN-LAST:event_viajesMenuBtnActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(MenuPrincipalFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(MenuPrincipalFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(MenuPrincipalFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(MenuPrincipalFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new MenuPrincipalFrame().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton automovilesBtn;
    private javax.swing.JMenuItem automovilesBtnMenu;
    private javax.swing.JMenu ayudaMenu;
    private javax.swing.JButton choferesBtn;
    private javax.swing.JMenuItem choferesBtnMenu;
    private javax.swing.JButton clientesBtn;
    private javax.swing.JMenuItem clientesBtnMenu;
    private javax.swing.JButton destinosFrecuentesBtn;
    private javax.swing.JMenuItem destinosFrecuentesBtnMenu;
    private javax.swing.JButton exitBtn;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenu menuMenu;
    private javax.swing.JButton nuevoPedidoBtn;
    private javax.swing.JMenuItem nuevoPedidoBtnMenu;
    private javax.swing.JButton viajesBtn;
    private javax.swing.JMenuItem viajesMenuBtn;
    // End of variables declaration//GEN-END:variables

    private void irAAltaPedido() {
        AltaPedidoFrame apf = new AltaPedidoFrame();
        apf.setVisible(true);
        this.dispose();
    }

    private void irAABMAutomoviles() {
        ABMAutomovilesFrame aaf = new ABMAutomovilesFrame();
        aaf.setVisible(true);
        this.dispose();
    }

    private void irAABMChoferes() {
        ABMChoferesFrame acf = new ABMChoferesFrame();
        acf.setVisible(true);
        this.dispose();
    }

    private void irAABMDestinosFrecuentes() {
        ABMDestinosFrecuentes adf = new ABMDestinosFrecuentes();
        adf.setVisible(true);
        this.dispose();
    }

    private void irAABMClientes() {
        ABMClientesFrame acf = new ABMClientesFrame();
        acf.setVisible(true);
        this.dispose();
    }

    private void irAAdministracionDeViajes() {
        AdministracionDeViajesFrame adv = new AdministracionDeViajesFrame();
        adv.setVisible(true);
        this.dispose();
    }
}
